package milkyway.hightech.comparators;

import milkyway.hightech.entry.Entry;

import java.math.BigInteger;

import java.util.Comparator;

/**
 *
 * @author michael
 */
public class SortByAmount implements Comparator<Entry>
{
    /**
     *
     * @param e1
     * @param e2
     * @return
     */
    @Override
    public int compare(Entry e1, Entry e2)
    {
        BigInteger m1 = e1.getMoney().getValue();
        BigInteger m2 = e2.getMoney().getValue();

        return m1.compareTo(m2);
    }
}